package cn.edu.nuc.util;

import cn.edu.nuc.dao.BaseTest;
import cn.edu.nuc.ssm.dao.AdminMapper;
import cn.edu.nuc.ssm.util.DateUtil;
import cn.edu.nuc.ssm.util.Md5Util;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by Administrator on 2017/4/10.
 */
public class Mytest extends BaseTest{

    private static Logger logger = LoggerFactory.getLogger(Mytest.class);

    @SuppressWarnings("SpringJavaAutowiringInspection")
    @Autowired
    private AdminMapper adminMapper;
    @Test
    public void testDate(){

        String currentMouthFirstDay = DateUtil.getCurrentMouthFirstDay();
        logger.debug(currentMouthFirstDay);
        String currentMountLastDay = DateUtil.getCurrentMouthLastDay();
        logger.debug(currentMountLastDay);
    }

    @Test
    public void testDateToString(){

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date();
        String format = simpleDateFormat.format(date);

        System.out.println(format);
    }
    @Test
    public void testgetMD5(){

        String dsfsdf = Md5Util.getMD5("123456");

        System.out.println(dsfsdf);
        adminMapper.findPageList(1,2);
    }



}
